
local socket = require("socket")
local client, m = socket.connect("localhost", 8173)

if m then
	error(m)
end

client:send('simple\n')

while true do
	local s = client:receive('*l')
	if not s then
		return
	end
	local src, line = string.match(s, '^(.*):%s*(%d+)$')
	print(src .. ': ' .. line)
	io.write('>')
	io.flush()
	local op = io.read()
	client:send(op..'\n')
end

